package com.retailshop.shopuser.mapper;

import com.retailshop.shopuser.entity.SignIn;
import com.retailshop.shopuser.entity.SignVoucher;
import com.retailshop.shopuser.entity.SignVoucherInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SignInMapper {

    int deleteByPrimaryKey(Integer signInId);

    int insert(SignIn record);

    int insertSelective(SignIn record);

    SignIn selectByPrimaryKey(Integer signInId);

    int updateByPrimaryKeySelective(SignIn record);

    int updateByPrimaryKey(SignIn record);

    SignVoucherInfo selectSignInByUsenoId(@Param("userNoId") int userNoId, @Param("signDays") int signDays);

    int updateSignDays(SignIn signIn);
    SignIn selectByUserNoId(int userNoId);

    /**
     * 更新所有的签到状态
     * @return
     */
    int updateSignState();

    SignVoucher selectVoucherByDays(int days);

    List<SignIn> selectList();

}